let vue=new Vue({
    el:'#main-container',
    data:{
        statute:{
            id:''
        },
        ueditorConfig:{
            UEDITOR_HOME_URL:'static/ueditor/',
            serverUrl: 'doUeditor',
        }
    },
    methods:{
        selectByid:function (id) {
            axios({
                url: `statute/selectByid/${id}`,
            }).then(rs => {
                this.statute = rs.data.obj
            }).catch(error => {
                layer.msg(error.message)
            })
        },doUpdate:function () {
            axios({
                url: 'statute/doUpdate',
                method:'put',
                data:this.statute
            }).then(rs=>{
                let index=parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                parent.layer.message='更新成功'
            }).catch(error=>{
                layer.msg(error.message)
            })
        },hideWindow:function () {
            let index=parent.layer.getFrameIndex(window.name);
            parent.layer.close(index)
        }
    },
    created:function(){
        this.selectByid(parent.layer.id)
    },
    mounted:function(){  //挂载el后  创建日期插件对象
        jeDate({
            dateCell: '#modifydate',
            format: 'YYYY-MM-DD hh:mm:ss',
            zIndex: 999999999,   //图层
            okfun:val => {//点击确定后的回调
                this.statute.createDate=val;
            },
            choosefun:val => {//选中日期后的回调
                this.statute.createDate=val;
            },
        });
    },
    components:{
        VueUeditorWrap
    }
});